package com.jorado.elasticsearch.model;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class ESConfiguration implements Serializable {
    private List<ESCluster> elasticsearch_cluster;
    private Map<String, ESIndexType> indexTypes;

    public List<ESCluster> getElasticsearch_cluster() {
        return elasticsearch_cluster;
    }

    public void setElasticsearch_cluster(List<ESCluster> elasticsearch_cluster) {
        this.elasticsearch_cluster = elasticsearch_cluster;
    }

    public ESCluster getESCluster(String name) {
        if (elasticsearch_cluster != null && elasticsearch_cluster.size() > 0) {
            for (ESCluster esCluster : elasticsearch_cluster) {
                if (esCluster.getName().equals(name))
                    return esCluster;
            }
        }
        return null;
    }

    public Map<String, ESIndexType> getIndexTypes() {
        return indexTypes;
    }

    public void setIndexTypes(Map<String, ESIndexType> indexTypes) {
        this.indexTypes = indexTypes;
    }
}
